require 'socket'

one_kb = 1024
Socket.tcp_server_loop(4481) do |conn|
  while data = conn.read(one_kb) do
    puts data
  end

  conn.close
end